package qldc.pm.qlktcsdldc.service.persistence;

import java.util.List;

import qldc.pm.qlktcsdldc.model.LichSuCongDan;
import qldc.pm.qlktcsdldc.utils.FLog;

import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.dao.orm.Type;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
import com.liferay.util.dao.orm.CustomSQLUtil;

public class LichSuCongDanFinderImpl extends BasePersistenceImpl<LichSuCongDan> implements LichSuCongDanFinder{
	private static final String LICHSUHOVATEN = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoVaTen";
	private static final String LICHSUNGAYSINH = LichSuCongDanFinderImpl.class.getName() + ".lichSuNgaySinh";
	private static final String LICHSUGIOITINH = LichSuCongDanFinderImpl.class.getName() + ".lichSuGioiTinh";
	private static final String LICHSUNOISINH = LichSuCongDanFinderImpl.class.getName() + ".lichSuNoiSinh";
	private static final String LICHSUQUEQUAN = LichSuCongDanFinderImpl.class.getName() + ".lichSuQueQuan";
	private static final String LICHSUDANTOC = LichSuCongDanFinderImpl.class.getName() + ".lichSuDanToc";
	private static final String LICHSUTONGIAO = LichSuCongDanFinderImpl.class.getName() + ".lichSuTonGiao";
	private static final String LICHSUQUOCTICH = LichSuCongDanFinderImpl.class.getName() + ".lichSuQuocTich";
	private static final String LICHSUCMND = LichSuCongDanFinderImpl.class.getName() + ".lichSuCMND";
	private static final String LICHSUHOCHIEU = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoChieu";
	private static final String LICHSUNOITHUONGTRU = LichSuCongDanFinderImpl.class.getName() + ".lichSuNoiThuongTru";
	private static final String LICHSUNOIOHIENTAI = LichSuCongDanFinderImpl.class.getName() + ".lichSuNoiOHienTai";
	
	private static final String LICHSUHOVATENCHA = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoVaTenCha";
	private static final String LICHSUSODDCNCHA = LichSuCongDanFinderImpl.class.getName() + ".lichSuSoDDCNCha";
	private static final String LICHSUQUOCTICHCHA = LichSuCongDanFinderImpl.class.getName() + ".lichSuQuocTichCha";
	private static final String LICHSUHOVATENME = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoVaTenMe";
	private static final String LICHSUSODDCNME = LichSuCongDanFinderImpl.class.getName() + ".lichSuSoDDCNMe";
	private static final String LICHSUQUOCTICHME = LichSuCongDanFinderImpl.class.getName() + ".lichSuQuocTichMe";
	private static final String LICHSUHOVATENVOCHONG = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoVaTenVoChong";
	private static final String LICHSUSODDVOCHONG = LichSuCongDanFinderImpl.class.getName() + ".lichSuSoDDVoChong";
	private static final String LICHSUQUOCTICHVOCHONG = LichSuCongDanFinderImpl.class.getName() + ".lichSuQuocTichVoChong";
	
	private static final String LICHSUHOVATENCHUHO = LichSuCongDanFinderImpl.class.getName() + ".lichSuHoVaTenChuHo";
	private static final String LICHSUQUANHECHUHO = LichSuCongDanFinderImpl.class.getName() + ".lichSuQuanHeChuHo";
	private static final String LICHSUSOSOHOKHAU = LichSuCongDanFinderImpl.class.getName() + ".lichSuSoSoHoKhau";
	private static final String LICHSULOAIHO = LichSuCongDanFinderImpl.class.getName() + ".lichSuLoaiHo";
	private static final String LICHSUSOHSHK = LichSuCongDanFinderImpl.class.getName() + ".lichSuSoHSHK";
	private static final String LICHSUNGHENGHIEP = LichSuCongDanFinderImpl.class.getName() + ".lichSuNgheNghiep";
	private static final String LICHSUNOILAMVIEC = LichSuCongDanFinderImpl.class.getName() + ".lichSuNoiLamViec";
	private static final String LICHSUODAUDEN = LichSuCongDanFinderImpl.class.getName() + ".lichSuODauDen";
	private static final String LICHSUNGAYDEN = LichSuCongDanFinderImpl.class.getName() + ".lichSuNgayDen";
	private static final String LICHSULYDODEN = LichSuCongDanFinderImpl.class.getName() + ".lichSuLyDoDen";
	private static final String LICHSUCHUYENDIDAU = LichSuCongDanFinderImpl.class.getName() + ".lichSuChuyenDiDau";
	private static final String LICHSUNGAYCHUYEN = LichSuCongDanFinderImpl.class.getName() + ".lichSuNgayChuyen";
	private static final String LICHSULYCHUYENDI = LichSuCongDanFinderImpl.class.getName() + ".lichSuLyChuyenDi";
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoVaTen( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoVaTen :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOVATEN);
			FLog.Log("searchByHoSo sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("hoVaTen", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);

			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNgaySinh( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNgaySinh :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNGAYSINH);
			FLog.Log("lichSuNgaySinh sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("ngaySinh", Type.DATE);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuGioiTinh( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuGioiTinh :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUGIOITINH);
			FLog.Log("lichSuGioiTinh sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("gioiTinh", Type.INTEGER);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNoiSinh( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNoiSinh :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNOISINH);
			FLog.Log("lichSuNoiSinh sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tinhId", Type.LONG);
			q.addScalar("quanHuyenId", Type.LONG);
			q.addScalar("phuongXaId", Type.LONG);
			q.addScalar("diaChi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQueQuan( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQueQuan :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUEQUAN);
			FLog.Log("lichSuQueQuan sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tinhId", Type.LONG);
			q.addScalar("quanHuyenId", Type.LONG);
			q.addScalar("phuongXaId", Type.LONG);
			q.addScalar("diaChi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuDanToc( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuDanToc :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUDANTOC);
			FLog.Log("lichSuDanToc sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tenDanToc", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuTonGiao( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuTonGiao :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUTONGIAO);
			FLog.Log("lichSuTonGiao sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tenTonGiao", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQuocTich( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQuocTich :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUOCTICH);
			FLog.Log("lichSuQuocTich sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("quocTich", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuCMND( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuCMND :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUCMND);
			FLog.Log("lichSuCMND sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soCMND", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoChieu( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoChieu :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOCHIEU);
			FLog.Log("lichSuHoChieu sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soHoChieu", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNoiThuongTru( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNoiThuongTru :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNOITHUONGTRU);
			FLog.Log("lichSuNoiThuongTru sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tinhId", Type.LONG);
			q.addScalar("quanHuyenId", Type.LONG);
			q.addScalar("phuongXaId", Type.LONG);
			q.addScalar("diaChi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNoiOHienTai( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNoiOHienTai :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNOIOHIENTAI);
			FLog.Log("lichSuNoiOHienTai sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tinhId", Type.LONG);
			q.addScalar("quanHuyenId", Type.LONG);
			q.addScalar("phuongXaId", Type.LONG);
			q.addScalar("diaChi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoVaTenCha( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoVaTenCha :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOVATENCHA);
			FLog.Log("lichSuHoVaTenCha sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("hoVaTenCha", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuSoDDCNCha( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuSoDDCNCha :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUSODDCNCHA);
			FLog.Log("lichSuSoDDCNCha sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soDDCNCha", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQuocTichCha( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQuocTichCha :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUOCTICHCHA);
			FLog.Log("lichSuQuocTichCha sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("quocTichCha", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoVaTenMe( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoVaTenMe :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOVATENME);
			FLog.Log("lichSuHoVaTenMe sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("hoVaTenMe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuSoDDCNMe( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuSoDDCNMe :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUSODDCNME);
			FLog.Log("lichSuSoDDCNMe sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soDDCNMe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQuocTichMe( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQuocTichMe :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUOCTICHME);
			FLog.Log("lichSuQuocTichMe sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("quocTichMe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoVaTenVoChong( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoVaTenVoChong :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOVATENVOCHONG);
			FLog.Log("lichSuHoVaTenVoChong sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("hoVaTenNguyenQuanHe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuSoDDVoChong( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuSoDDVoChong :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUSODDVOCHONG);
			FLog.Log("lichSuSoDDVoChong sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soDDCNNguoiQuanHe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQuocTichVoChong( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQuocTichVoChong :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUOCTICHVOCHONG);
			FLog.Log("lichSuQuocTichVoChong sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("quocTichNguoiQuanHe", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuHoVaTenChuHo( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuHoVaTenChuHo :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUHOVATENCHUHO);
			FLog.Log("lichSuHoVaTenChuHo sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("hoVaTenChuHo", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuQuanHeChuHo( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuQuanHeChuHo :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUQUANHECHUHO);
			FLog.Log("lichSuQuanHeChuHo sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tenQuanHeGiaDinh", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuSoSoHoKhau( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuSoSoHoKhau :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUSOSOHOKHAU);
			FLog.Log("lichSuSoSoHoKhau sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soSoHoKhau", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuLoaiHo( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuLoaiHo :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSULOAIHO);
			FLog.Log("lichSuLoaiHo sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("loaiHo", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuSoHSHK( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuSoHSHK :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUSOHSHK);
			FLog.Log("lichSuSoHSHK sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("soHSHK", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNgheNghiep( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNgheNghiep :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNGHENGHIEP);
			FLog.Log("lichSuNgheNghiep sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("ngheNghiep", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNoiLamViec( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNoiLamViec :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNOILAMVIEC);
			FLog.Log("lichSuNoiLamViec sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("tinhId", Type.LONG);
			q.addScalar("quanHuyenId", Type.LONG);
			q.addScalar("phuongXaId", Type.LONG);
			q.addScalar("diaChi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuODauDen( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuODauDen :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUODAUDEN);
			FLog.Log("lichSuNoiSinh sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("oDauDenTinhId", Type.LONG);
			q.addScalar("oDauDenQuanHuyenId", Type.LONG);
			q.addScalar("oDauDenPhuongXaId", Type.LONG);
			q.addScalar("oDauDen", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNgayDen( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNgayDen :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNGAYDEN);
			FLog.Log("lichSuNgayDen sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("ngayChuyenDen", Type.DATE);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuLyDoDen( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuLyDoDen :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSULYDODEN);
			FLog.Log("lichSuLyDoDen sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("lyDoChuyenDen", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuChuyenDiDau( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuChuyenDiDau :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUCHUYENDIDAU);
			FLog.Log("lichSuChuyenDiDau sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("chuyenDiDauTinhId", Type.LONG);
			q.addScalar("chuyenDiDauQuanHuyenId", Type.LONG);
			q.addScalar("chuyenDiDauPhuongXaId", Type.LONG);
			q.addScalar("chuyenDiDau", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuNgayChuyen( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuNgayChuyen :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSUNGAYCHUYEN);
			FLog.Log("lichSuNgayChuyen sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("ngayChuyenDi", Type.DATE);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	public List<Object[]> lichSuLyChuyenDi( String soDinhDanhCaNhan)throws SystemException {
		FLog.Log("lichSuLyChuyenDi :" + soDinhDanhCaNhan);
		
		Session session = null;
		try {
			session = openSession();
			String sql = CustomSQLUtil.get(LICHSULYCHUYENDI);
			FLog.Log("lichSuLyChuyenDi sql:" + sql);

			sql = CustomSQLUtil.replaceAndOperator(sql, true);

			SQLQuery q = session.createSQLQuery(sql);
			q.setCacheable(false);

			q.addScalar("thoiGianThaoTac", Type.DATE);
			q.addScalar("nguoiDungId", Type.LONG);
			q.addScalar("lyDoChuyenDi", Type.STRING);
			q.addScalar("giaiThich", Type.STRING);
			
			QueryPos qpos = QueryPos.getInstance(q);
			qpos.add(soDinhDanhCaNhan);
			
			return (List<Object[]>) QueryUtil.list(q, getDialect(), -1, -1);

		}
		catch (Exception e) {
			throw new SystemException(e);
		}
		finally {
			if (Validator.isNotNull(session)) {
				closeSession(session);
			}
		}
	}
}
